#pragma once

#include "RectEd.h"

class LookFeelSkinEd
{
public:
	LookFeelSkinEd();
	~LookFeelSkinEd();

	void Layout();
	MGUI_Layout * GetLayout() { return mLayout; }

protected:
	void OnEditSkinChanged_(Texture * _skin);
	void OnEditRectChanged_(MGUI_Rect _rect);
	void OnEditClientChanged_(MGUI_ClientRect _rect);
	void OnRectEdChanged_(MGUI_Rect _rect);

	void OnSkinMousePressed_(int _x, int _y, MGUI_MouseButton _id);
	void OnSkinMouseReleased_(int _x, int _y, MGUI_MouseButton _id);
	void OnSkinMouseMove_(int _x, int _y);


protected:
	MGUI_Layout * mLayout;
	MGUI_ImageBox * mImageBox_Back;
	MGUI_ImageBox * mImageBox_Skin;

	RectEd * mRectEd;

	bool mEnableDrag;
	MGUI_Rect mTmpRect;
	int mTmpX, mTmpY;

	tListener3<LookFeelSkinEd, int, int, MGUI_MouseButton> OnSkinMousePressed;
	tListener3<LookFeelSkinEd, int, int, MGUI_MouseButton> OnSkinMouseReleased;
	tListener2<LookFeelSkinEd, int, int> OnSkinMouseMove;

	tListener1<LookFeelSkinEd, Texture *> OnEditSkinChanged;
	tListener1<LookFeelSkinEd, MGUI_Rect> OnEditRectChanged;
	tListener1<LookFeelSkinEd, MGUI_ClientRect> OnEditClientChanged;
	tListener1<LookFeelSkinEd, MGUI_Rect> OnRectEdChanged;
};

